'use strict';

module.exports = app => {
  const { DECIMAL, INTEGER, STRING, DATE } = app.Sequelize;

  const Bill = app.model.define('bills', {
    id: { type: INTEGER, primaryKey: true, autoIncrement: true },
    balance: {
      type: DECIMAL(10, 2),
      defaultValue: 0.0,
      comment: '账户余额(元)',
    },
    price: {
      type: STRING,
      comment: '金额变动',
    },
    user_id: {
      type: INTEGER,
      allowNull: false,
      comment: '用户id',
    },
    bz: {
      type: STRING,
      comment: '备注',
    },
    created_at: DATE,
    updated_at: DATE,
  });

  return Bill;
};
